<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #result {
      height: 100px;
      width: 100px;
      border: 1px solid red;
    }
  </style>
  <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
  <button>点击发送jsonp请求</button>
  <div id="result"></div>
  <script>
    $('button').eq(0).click(function() {
      $.getJSON('http://127.0.0.1:8000/check-username?callback=?', function(data) {
        console.log(data);
        $('#result').html(data.msg)
      })
    })
  </script>
</body>
</html>